import request from '@/utils/request';

// 查询列表
export async function queryRoleList(params) {
  return request('/s/role/queryPageList', {
    method: 'POST',
    data: params,
  });
}

// 新增
export async function addRole(params) {
  return request('/s/role/add', {
    method: 'POST',
    data: params,
  });
}

// 删除
export async function deleteRole(params) {
  return request('/s/role/delete', {
    method: 'POST',
    data: params,
  });
}

// 修改
export async function updateRole(params) {
  return request('/s/role/update', {
    method: 'POST',
    data: params,
  });
}

// 查询树形组织
export async function queryTreeOrgList(params) {
  return request('/s/org/queryTree', {
    method: 'POST',
    data: params,
  });
}

// 查询组织列表
export async function queryOrgList(params) {
  return request('/s/user/queryPageList', {
    method: 'POST',
    data: params,
  });
}

// 绑定用户
export async function addUserRole(params) {
  return request('/s/role/addUserRole', {
    method: 'POST',
    data: params,
  });
}


// 查询菜单树
export async function queryMenuTree(params) {
  return request('/s/role/queryAuthMenuTree', {
    method: 'POST',
    data: params,
  });
}

export async function queryUserList(params) {
  return request('/s/user/queryPageList', {
    method: 'POST',
    data: params,
  });
}


// 菜单授权
export async function addMenuRight(params) {
  return request('/s/role/addMenuRight', {
    method: 'POST',
    data: params,
  });
}
// 查询用户菜单，区别是这个是真正的返回给前台展示的菜单，格式要求非常严格
export async function queryMenuData(params) {
  return request('/s/role/queryUserMenuTree', {
    method: 'POST',
    data: params,
  });
}

// 查询所有的绑定人员
export async function queryListForRoleId(params) {
  return request('/s/role/queryListForRoleId', {
    method: 'POST',
    data: params,
  });
}

